<template>
	<div class="z_box">
		<div class="box">
			<i class="el-icon-close close" @click='close()'></i>
			<div class="title">{{data.docSubject}}</div>
			<div v-html='data.docContent' class="content">

			</div>
			<div class="download-wrapper">
			   <div v-for="(item,index) in data.oaAttachList" :key="item.fdFileId" v-show="data.oaAttachList.length > 0">
			     <el-link @click="gotoFilePage(item.fdFileId)" type="primary" class="download-href"
			       >附件{{index+1}}: {{item.fdFileName}}</el-link
			     >
			   </div>
			 </div>
			<!-- <el-button type="primary" class="btn" @click='btn()'>确认</el-button> -->
		</div>
	</div>
</template>

<script>
	export default{
		props:['data'],
		data() {
			return{

			}
		},
		mounted() {
			console.log(this.data)
		},
		methods:{
		  gotoFilePage(fdId) {
			if(fdId) {
			  window.open('javascript:window.name;', '<script>location.replace("http://office.ncpu.edu.cn/sys/attachment/sys_att_main/sysAttMain.do?method=view&fdId='+fdId+'")<\/script>');
			}
		  },
			close(){
				this.$emit('close','')
			}
		}
	}
</script>

<style scoped>
.z_box {
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		background: rgb(0, 0, 0, 0.3);
		z-index: 999;
	}

	.box {
		position: absolute;
		max-width: 2000px;
		min-width: 1000px;
		height: 600px;
		background-color: #fff;
		color: #000;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
		border-radius: 10px;
		display: flex;
		flex-direction: column;
	}

	.content {
		height: 90%;
		overflow-y: scroll;
		padding: 20px 30px;
	}

	.btn {
		width: 100px;
		position: absolute;
		bottom: 10px;
		right: 10px;
	}

	.title {
		display: flex;
		align-items: center;
		justify-content: center;
		margin-top: 20px;
		font-size: 20px;
		font-weight: bold;
		padding: 0 50px;
	}

	.close {
		position: absolute;
		right: 20px;
		top: 10px;
		font-size: 24px;
		cursor: pointer;
	}
  
  .download-wrapper {
    font-size: 18px;
    margin: 24px 12px 0;
    .download-href {
      margin-bottom: 10px;
    }
  }
</style>
